import storage from 'good-storage'

// 存底部导航栏activeid
const ACTIVE_ID = '__activeid__'
export function saveActiveId(activeid) {
  storage.session.set(ACTIVE_ID, activeid)
}
export function loadActiveId() {
  return storage.session.get(ACTIVE_ID)
}
// 存小区名称
const TITLE = '__title__'
export function saveTitle(title) {
  storage.set(TITLE, title)
}
export function loadTitle() {
  return storage.get(TITLE)
}
// 存城市名称
const CITY = '__city__'
export function saveCity(city) {
  storage.set(CITY, city)
}
export function loadCity() {
  return storage.get(CITY)
}
// 存城市Id
const CITY_ID = '__cityid__'
export function saveCityId(cityid) {
  storage.set(CITY_ID, cityid)
}
export function loadCityId() {
  return storage.get(CITY_ID)
}
export function clearCity() {
  storage.remove(CITY)
  return ''
}
// 存openid
const OPEN_ID = '__openid__'
export function saveOpenId(openid) {
  storage.set(OPEN_ID, openid)
}
export function loadOpenId() {
  return storage.get(OPEN_ID)
}
// 存用户名字和手机号码
const PHONE_NAME = '__phonename__'
export function savePhoneName(phonename) {
  storage.set(PHONE_NAME, phonename)
}
export function loadPhoneName() {
  return storage.get(PHONE_NAME)
}
// 存用户ID
const USER_ID = '__userid__'
export function saveUserId(userid) {
  storage.set(USER_ID, userid)
}
export function loadUserId() {
  return storage.get(USER_ID)
}
// 存查验点击的类别id
const CLICK_DATA = '__clickdata__'
export function saveClickData(clickdata) {
  storage.session.set(CLICK_DATA, clickdata)
}
export function loadClickData() {
  return storage.session.get(CLICK_DATA)
}
// 缓存电梯编号
const LIFT_NUM = '__liftnum__'
export function saveLiftNum(liftnum) {
  storage.session.set(LIFT_NUM, liftnum)
}
export function loadLiftNum() {
  return storage.session.get(LIFT_NUM)
}
export function clearLiftNum() {
  storage.session.remove(LIFT_NUM)
}
// 投票统计缓存小区苑幢单元
const AREAS_NAME = '__areasname__'
export function saveAreasName(areasname) {
  storage.session.set(AREAS_NAME, areasname)
}
export function loadAreasName() {
  return storage.session.get(AREAS_NAME)
}
